tools/xl: show shutdown reason code, improve xl list heading
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 23 Nov 2010 19:36:14 +0000 (19:36 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 23 Nov 2010 19:36:14 +0000 (19:36 +0000)
commite1475a6693aac8cddc4bdd456548aa05a625556b
tree620e26dc45acc58216a6e298d4c04319ada955d5
parent9d679c393b1dc14c9feb68d9a6461787af378714
tools/xl: show shutdown reason code, improve xl list heading

Previously, xl list would not reveal the shutdown reason code unless
it was SHUTDOWN_crashed.  This is unfortunate; it makes it hard for
scripts which use xl to tell what's going on.

In this patch:

 * xl list shows the reason code as a single letter if it is
   any of the defined values from sched.h:
       -   poweroff or domain not shut down
       r   reboot
       s   suspend
       c   crashed
       w   watchdog
   This is not 100% backward-compatible with xm but I think it's a
   justifiable improvement.  It would be nice to make the same change
   to xm.

 * xl list -v shows the full numeric reason code in hex, or "-" if the
   domain is not shut down.

 * xl list -v has column headings for the UUID and numeric reason
   code.  The heading for the reason code overlaps with the UUID a bit.
   These headings are intended for human readers; scripts can parse
   the output by breaking on whitespace.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c